
#ifndef __UM_HTTP_SOCKET_INPUT_BUFFER_H
#define __UM_HTTP_SOCKET_INPUT_BUFFER_H

#include "AbstractInputStream.hpp"

class SocketInputStream : public AbstractInputStream
{
	virtual int fillBuffer(void* buffer, int length) {
		if (length <= 0) {
			return 0;
		}
		return recv(m_sock, (char*)buffer, length, 0);
	}

public:

	SocketInputStream(SOCKET s) : m_sock(s) {
	}

private:

	SOCKET m_sock;

};

#endif // __UM_HTTP_SOCKET_INPUT_BUFFER_H